<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateMenusTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('menus', function (Blueprint $table) {
            $table->bigIncrements('id');
            $table->string('path')->comment('路径');
            $table->string('name', 30)->unique()->comment('路由名称');
            $table->string('label', 30)->comment('菜单名称');
            $table->bigInteger('pid')->unsigned()->default(0)->index()->comment('父级id');
            $table->tinyInteger('is_show')->unsigned()->default(1)->comment('是否显示');
            $table->string('icon', 30)->default('')->comment('图标');
            $table->string('url')->comment('视图文件路径');
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('menus');
    }
}
